<body>
  <div style="height: 100px">
    <p style="font-size: 40px">
      键盘:<a href="javascript:sendEvent()">Event</a>
    </p>
  </div>
  <div>
    <iframe
      src="./game/index.html"
      style="width: 720px; height: 1280px"
      id="iFrame"
    >
    </iframe>
  </div>
</body>
<script>
  function sendEvent() {
    let myFrame = document.getElementById("iFrame").contentWindow;
    let game = myFrame.document.getElementById("GameCanvas");
    let e = new Event("foobar");
    game.dispatchEvent(e);
  }
</script>
